import { http } from '@/utils/http'
export interface IRecord {
	id: number
	user_id: number
	result: string
	image: string
	res_image: string
	size: number
	length: number
	width: number
	description: string
	created_at: string
	updated_at: string
}

/** 根据用户ID获取所有结核检测记录信息并保存到store中 */
export const getRecordsByUserIDAPI = (user_id: number) => {
  return http.get<IRecord[]>(`/records/user/${user_id}`)
}

/** 根据ID获取单个结核检测记录信息并保存到store中 */
export const getRecordByIDAPI = (record_id: number) => {
  return http.get<IRecord[]>(`/records/${record_id}`)
}

/** 根据ID获取单个结核检测记录信息并保存到store中 */
export const deleteRecordByIDAPI = (record_id: number) => {
  return http.post(`/records/delete/${record_id}`)
}